"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable("VisitLogs", {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER,
      },
      ip: {
        type: Sequelize.STRING,
      },
      path: {
        type: Sequelize.STRING,
      },
      level: {
        type: Sequelize.STRING,
      },
      message: {
        type: Sequelize.STRING,
      },
      meta: {
        type: Sequelize.STRING(2048),
      },
      route: {
        type: Sequelize.STRING,
      },
      method: {
        type: Sequelize.STRING,
      },
      originName: {
        type: Sequelize.STRING,
      },
      user: {
        type: Sequelize.STRING,
      },
      query: {
        type: Sequelize.TEXT,
      },
      body: {
        type: Sequelize.TEXT,
      },
      userAgent: {
        type: Sequelize.STRING,
      },
      timestamp: {
        type: Sequelize.DATE,
      },
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable("VisitLogs");
  },
};
